home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1989 / Sep 89 / Y0054-Re Uses Clause-Sep89 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.2 KB  |  38 lines  |  [TEXT/GEOL]

  1. Item    2833047                         15-Sept-89        09:56
  2.  
  3. From:   ALGER                           Alger, Jeff,VCA
  4.  
  5. To:     D2999                           Catalyst, Richard Wolfson,PRT
  6.  
  7. cc:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. Sub:    Response to Uses Clause
  10.  
  11. Steve,
  12.  
  13. Here is a simplified set of rules:
  14.  
  15. • A type must be declared before it can be referenced as part of another type.
  16. • A constant must be declared before it can be referenced in another constant.
  17.  
  18. This leads to the following:
  19.  
  20. 1. If unit A's interface is dependent on unit B's interface and you Use unit A
  21. anywhere, then you must preceed it with B in the Uses clause.
  22. 2. Rule 1 must be applied recursively.
  23.  
  24. Remember: you need only worry about dependencies amongst the interfaces, not
  25. the implementation sections.
  26.  
  27. One way to manage this mess is to construct a directed graph of dependencies
  28. amongst the interfaces.  The nodes are the units.  Draw an arrow from unit A to
  29. unit B if unit A's interface depends on any type, constant, etc., declared in
  30. unit B.  When you construct the Uses clause for a new unit, make sure that unit
  31. X appears before unit Y whenever there is a path from Y to X.
  32.  
  33. Hope that helps.
  34.  
  35. Jeff Alger
  36. KPMG Peat Marwick
  37.  
  38.